#pragma once

#include "Shape.h"

class Circ: public Shape {
private:
	/*
	Default constructor, avoid using this.
	*/
	Circ();

	float radius; // size of the circle
public:
	/*
	Create a Circ that follows the given Transform and has the given radius.
	@param	position		Transform to follow.
	@param	rad				Radius of the circle.
	*/
	Circ(Transform* const position, float rad);
	/*
	Create a Circ that follows the given Transform and has the given radius.
	@param	position		Transform to follow.
	@param	posOffset		Offset to apply to the Transform being followed.
	@param	rad				Radius of the circle.
	*/
	Circ(Transform* const position, const Vector2D& posOffset, float rad);
	/*
	Create a Circ that follows the given Transform and has the given radius.
	@param	position		Transform to follow.
	@param	xOffset			Offset in x to apply to the Transform being followed.
	@param	yOffset			Offset in y to apply to the Transform being followed.
	@param	rad				Radius of the circle.
	*/
	Circ(Transform* const position, float xOffset, float yOffset, float rad);
	/*
	Destructor.
	*/
	~Circ();

	/*
	@return	Radius of the Circ.
	*/
	float GetRadius() const { return radius; }
	/*
	@return	Square of the radius of the Circ.
	*/
	float GetRadiusSq() const { return radius * radius; }

	/*
	Get the square of the distance with the given position.
	@param	x			Position of the point in x.
	@param	y			Position of the point in y.
	@return	Square of the distance between this and the given position.
	*/
	float SqDistanceWith(float x, float y) const;
	/*
	Get the square of the distance with the given position.
	@param	p			Position of the point.
	@return	Square of the distance between this and the given position.
	*/
	float SqDistanceWith(const Vector2D& p) const;

	/*
	Check if a given point is inside the circle.
	@param	x			Position of the point in x.
	@param	y			Position of the point in y.
	@return	Wether the point is inside the circle or not.
	*/
	bool Contains(float x, float y) const;
	/*
	Check if a given point is inside the circle.
	@param	p			Position of the point.
	@return	Wether the point is inside the circle or not.
	*/
	bool Contains(const Vector2D& p) const;
	/*
	Check if there is a collision with the given Shape.
	@param	l			Shape to check the collision with.
	@param	hitOut		Vector to store the hit location to in case of collision.
	@return	Wether the two objects collide or not.
	*/
	bool CollidesWith(const Line* const l, Vector2D& hitOut) const;
	/*
	Check if there is a collision with the given Shape.
	@param	r			Shape to check the collision with.
	@param	hitOut		Vector to store the hit location to in case of collision.
	@return	Wether the two objects collide or not.
	*/
	bool CollidesWith(const Rect* const r, Vector2D& hitOut) const;
	/*
	Check if there is a collision with the given Shape.
	@param	c			Shape to check the collision with.
	@param	hitOut		Vector to store the hit location to in case of collision.
	@return	Wether the two objects collide or not.
	*/
	bool CollidesWith(const Circ* const c, Vector2D& hitOut) const;
	/*
	Check if there is a collision with the given Shape.
	@param	p			Shape to check the collision with.
	@param	hitOut		Vector to store the hit location to in case of collision.
	@return	Wether the two objects collide or not.
	*/
	bool CollidesWith(const Poly* const p, Vector2D& hitOut) const;

	/*
	DO NOT USE THIS METHOD.
	*/
	void Draw() const;
	/*
	Display the rectangle information in the console.
	*/
	void COut() const;
};

